<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Title</title>
</head>
<body>
    <form action="#" th:acthion="@{/}" th:object="${personForm}" method="post">
        <table>
            <tr><td>Name:</td>
                <td><input type="text" th:field="*{name}" /></td>
                <td th:if="${#fields.hasErrors('name')}" th:errors="*{name}">Name Error</td>
            </tr>
            <tr><td>Age:</td>
                <td><input type="text" th:field="*{age}" /></td>
                <td><td th:if="${#fields.hasErrors('age')}" th:errors="*{age}">Age Error</td></td>
            </tr>
            <tr>
                <td><button type="submit">Submit</button></td>
            </tr>
        </table>
    </form>
</body>
</html>